package com.topisv.tms.service.edb;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Sort;
import org.springframework.data.domain.Sort.Direction;
import org.springframework.data.jpa.domain.Specification;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;

import com.topisv.tms.entity.Task;
import com.topisv.tms.entity.edb.EdbTask;
import com.topisv.tms.repository.TaskDao;
import com.topisv.tms.repository.edb.EdbTaskDao;

import org.springside.modules.persistence.DynamicSpecifications;
import org.springside.modules.persistence.SearchFilter;
import org.springside.modules.persistence.SearchFilter.Operator;

//Spring Bean的标识.
@Component
// 默认将类中的所有public函数纳入事务管理.
@Transactional(readOnly = true)
public class EdbTaskService {

	@Autowired
	private EdbTaskDao edbTaskDao;

	
	@Transactional(readOnly = false)
	public void save(EdbTask entity) {
		edbTaskDao.save(entity);
	}

	@Transactional(readOnly = false)
	public void deleteTask(Long id) {
		edbTaskDao.delete(id);
	}

	public List<EdbTask> findByMethodAndStatus(String method,String status) {
		return edbTaskDao.findByMethodAndStatus(method,status);
	}
	
	public EdbTask findTask(String customerCode,String whCode,String method)
	{
		return edbTaskDao.findTask(customerCode, whCode, method);
	}

	
}
